package com.mcflies.ui.listView;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.widget.SimpleAdapter;

import com.mcflies.commons.CornerListView;
import com.mcflies.ui.R;

/**
 * @author:mcfly_jun
 * @create_date:2012-8-16
 * @comment:圆角listview
 */
public class CornerListViewActivity extends Activity {
	private CornerListView cornerListView;
	private List<Map<String, String>> listData;
	private SimpleAdapter adapter;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		super.onCreate(savedInstanceState);

		setContentView(R.layout.android_corner_list_view_main);
		initWidget();
		initData();

		adapter = new SimpleAdapter(getApplicationContext(), listData,
				R.layout.android_corner_list_view_item,
				new String[] { "text" },
				new int[] { R.id.cornerListViewItem_TV });
		cornerListView.setAdapter(adapter);
	}

	private void initWidget() {
		cornerListView = (CornerListView) findViewById(R.id.cornerListView_LV);
	}

	private void initData() {
		listData = new ArrayList<Map<String, String>>();

		Map<String, String> map = new HashMap<String, String>();
		map.put("text", "图库更新");
		listData.add(map);

		map = new HashMap<String, String>();
		map.put("text", "收藏图片");
		listData.add(map);

		map = new HashMap<String, String>();
		map.put("text", "下载目录");
		listData.add(map);
	}
}
